<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Category extends Model {

    protected $table = 't_category';
    protected $fillable  = ['categoryid','name','rank','parentid','isShow','content','smallimgurl','bigimgurl','inputDate','updateDate'];
    protected $primaryKey = 'categoryid';
    public $timestamps = false;

    public function parent()
    {
        return $this->belongsTo('App\Category', 'parentid');
    }
}
